#include "device.h"

Device::Device()
{
    
}

int Device::getDeviceID()
{
    return deviceID;
}

int Device::getProductID()
{
    return productID;
}

int Device::getBuildingID()
{
    return buildingID;
}

QString Device::getDeviceName()
{
    return deviceName;
}

QString Device::getDevicePA()
{
    return devicePA;
}

QString Device::getAppProgram()
{
    return appProgram;
}

int Device::getAdr()
{
    return adr;
}

int Device::getPrg()
{
    return prg;
}

int Device::getPar()
{
    return par;
}

int Device::getGrp()
{
    return grp;
}

int Device::getCfg()
{
    return cfg;
}

QString Device::getDeviceManufacturer()
{
    return deviceManufacturer;
}

QString Device::getDeviceOrderNum()
{
    return deviceOrderNum;
}

QString Device::getDeviceProduct()
{
    return deviceProduct;
}

QString Device::getDeviceUnitType()
{
    return deviceUnitType;
}

QString Device::getDeviceManufacturerData()
{
    return deviceManufacturerData;
}

QString Device::getDeviceVersion()
{
    return deviceVersion;
}

QString Device::getDeviceDBName()
{
    return deviceDBName;
}

QString Device::getDeviceSN()
{
    return deviceSN;
}

void Device::setDeviceID(int _deviceID)
{
    deviceID = _deviceID;
}

void Device::setProductID(int _productID)
{
    productID = _productID;
}

void Device::setBuildingID(int _buildingID)
{
    buildingID = _buildingID;
}

void Device::setDeviceName(QString _deviceName)
{
    deviceName = _deviceName;
}

void Device::setDevicePA(QString _devicePA)
{
    devicePA = _devicePA;
}

void Device::setAppProgram(QString _appPgogram)
{
    appProgram = _appPgogram;
}

void Device::setAdr(int _adr)
{
    adr = _adr;
}

void Device::setPrg(int _prg)
{
    prg = _prg;
}

void Device::setPar(int _par)
{
    par = _par;
}

void Device::setGrp(int _grp)
{
    grp = _grp;
}

void Device::setCfg(int _cfg)
{
    cfg = _cfg;
}

void Device::setDeviceManufacturer(QString _deviceManufacturer)
{
    deviceManufacturer = _deviceManufacturer;
}

void Device::setDeviceOrderNum(QString _deviceOrderNum)
{
    deviceOrderNum = _deviceOrderNum;
}

void Device::setDeviceProduct(QString _deviceProduct)
{
    deviceProduct = _deviceProduct;
}

void Device::setDeviceUnitType(QString _deviceUnitType)
{
    deviceUnitType = _deviceUnitType;
}

void Device::setDeviceManufacturerData(QString _deviceManufacturerData)
{
    deviceManufacturerData = _deviceManufacturerData;
}

void Device::setDeviceVersion(QString _deviceVersion)
{
    deviceVersion = _deviceVersion;
}

void Device::setDeviceDBName(QString _deviceDBName)
{
    deviceDBName = _deviceDBName;
}

void Device::setDeviceSN(QString _deviceSN)
{
    deviceSN = _deviceSN;
}

void Device::setAll(int _deviceID, int _productID, int _buildingID, QString _name, 
                    QString _PA, QString _appProgram, int _adr, int _prg, int _par, 
                    int _grp, int _cfg, QString _manufactures, QString _orderNum, 
                    QString _product, QString _unitType, QString _manufacturesData,
                    QString _version, QString _dbName, QString _SN)
{
    deviceID = _deviceID;
    productID = _productID;
    buildingID = _buildingID;
    deviceName = _name;
    devicePA = _PA;
    appProgram = _appProgram;
    adr = _adr;
    prg = _prg;
    par = _par;
    grp = _grp;
    cfg = _cfg;
    deviceManufacturer = _manufactures;
    deviceOrderNum = _orderNum;
    deviceProduct = _product;
    deviceUnitType = _unitType;
    deviceManufacturerData = _manufacturesData;
    deviceVersion = _version;
    deviceDBName = _dbName;
    deviceSN = _SN;
}

bool Device::saveAllToDeviceTable(int _deviceID, int _productID, int _buildingID, QString _name, 
                         QString _PA, QString _appProgram, int _adr, int _prg, int _par, 
                         int _grp, int _cfg, QString _manufactures, QString _orderNum, 
                         QString _product, QString _unitType, QString _manufacturesData,
                         QString _version, QString _dbName, QString _SN, QString _describe)
{
    return insertDevice(_deviceID, _productID, _buildingID, _name, _PA, _appProgram, _adr, _prg, _par, _grp, _cfg, _manufactures, _orderNum, 
                        _product, _unitType, _manufacturesData, _version, _dbName, _SN, _describe);
}

bool Device::addDeviceToBuilding(int _id, QString _name, QString _describe, int _num, int _upID, int _type)
{
    return insertBuilding(_id, _name, _describe, _num, _upID, _type);
}
